<nav id="sidebar" class="navbar-default navbar-static-side" role="navigation">
    <div class="sidebar-collapse menu-scroll">
        <ul id="side-menu" class="nav">

            {foreach $groups as $key=>$group}
            <li class="{if $key==0}active{/if}">
                <a href="#">
                    <span class="menu-title">{$group.title}</span><span class="fa arrow"></span>
                </a>
                <ul class="nav nav-second-level collapse in">
                    {foreach $group['children'] as $item}
                    {if $template=='mobile'}
                    <li {eq name="pageid" value="$item.id"}class="active"{/eq}><a target="pathFrame" href="{:url("@index/page/index",["pid"=>$item.id,"template"=>$template])}">{$item['title']}</a></li>
                    {else}
                    <li {eq name="pageid" value="$item.id"}class="active"{/eq}><a target="pathFrame" href="{:url("@diygw/page/index",["pid"=>$item.id,"template"=>$template])}">{$item['title']}</a></li>
                    {/if}
                    {/foreach}
                </ul>
            </li>
            {/foreach}
            {if $template=='web'}
            <li>
                <a href="#">
                    <span class="menu-title">订单管理</span><span class="fa arrow"></span>
                </a>
                <ul class="nav nav-second-level collapse">
                    <li><a target="pathFrame" href="{:url('@diygw/order/index')}">订单管理</a></li>
                </ul>
            </li>
            <li>
                <a href="#">
                    <span class="menu-title">后台管理</span><span class="fa arrow"></span>
                </a>
                <ul class="nav nav-second-level collapse">
                    <li><a target="pathFrame" href="{:url("@diygw/admin/pages",["id"=>$id])}">页面管理</a></li>
                    <li><a target="pathFrame" href="{:url("@diygw/admin/xcx",["id"=>$id])}">小程序配置</a></li>
                    <li><a target="pathFrame" href="{:url("@diygw/menu/index")}">自定义菜单管理</a></li>
                </ul>
            </li>
            {/if}
        </ul>
    </div>
</nav>